import player_rabbit from "../rabbit/player_rabbit"
import gameScene2 from "../Game/gameScene2"

export default class gameOver2 extends Laya.Script {
    
    constructor() { super(); }
    private gameover_panel:Laya.Sprite
    
    onEnable(): void {
        this.gameover_panel = this.owner.parent.getChildByName("gameover_panel")as Laya.Sprite

    }


    onTriggerEnter(other: any, self: any) {
        console.log(other.label)
        if (other.label == "player1" || other.label == "player2") {
            this.gameover_panel.visible = true
            player_rabbit._intance.enabled = false
            gameScene2._intance.num = 0
        }
    }


    onDisable(): void {
    }
}